﻿<UserControl x:Class="VKontakteClient.Friends"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Local="clr-namespace:VKontakteClient" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" DataContextChanged="UserControl_DataContextChanged">
    <Border CornerRadius="5" BorderBrush="Black" BorderThickness="1" Background="AliceBlue" MinWidth="200" MinHeight="200" >
        <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="5">
            <Grid.RowDefinitions>
                <RowDefinition Height="25"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Center" >
            <Button Grid.Row="0" Content="Обновить список" HorizontalAlignment="Left" VerticalAlignment="Center" x:Name="RefreshBtn" Click="Button_Click" />
            <Button Grid.Row="0" Content="Обновить информации всех" Margin="10,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" x:Name="RefreshBtn1" Click="RefreshBtn1_Click" />
            </StackPanel>
            <ItemsControl Grid.Row="1" x:Name="FriendsList" HorizontalContentAlignment="Stretch" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling">
                <ItemsControl.Template>
                    <ControlTemplate TargetType="ItemsControl">
                        <ScrollViewer CanContentScroll="True" IsDeferredScrollingEnabled="True" >
                            <ItemsPresenter />
                        </ScrollViewer>
                    </ControlTemplate>
                </ItemsControl.Template>
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <VirtualizingStackPanel VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Standard"/>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Local:MiniProfileControl  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="10" MouseLeftButtonUp="MiniProfileControl_MouseLeftButtonUp" />
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </Grid>
    </Border>
</UserControl>
